#include "CudaGrid.cuh"

using namespace solar::cuda;

/**
 * Getters and setters of attributes for Grid object.
 */
auto CudaGrid::getGridType() const -> int { return type_; }

void CudaGrid::setGridType(int type) { type_ = type; }

void CudaGrid::setPosition(float3 pos) { pos_ = pos; }

auto CudaGrid::getSize() const -> float3 { return size_; }

void CudaGrid::setSize(float3 size) { size_ = size; }

void CudaGrid::setInterval(float3 interval) { interval_ = interval; }

auto CudaGrid::getHeliostatType() const -> int { return helio_type_; }
void CudaGrid::setHeliostatType(int helio_type) { helio_type_ = helio_type; }

auto CudaGrid::getStartHeliostatIndex() const -> int { return start_helio_index_; }

void CudaGrid::setStartHeliostatIndex(int start_helio_index)
{
    start_helio_index_ = start_helio_index;
}

auto CudaGrid::getNumberOfHeliostats() const -> int { return num_helios_; }

void CudaGrid::setNumberOfHeliostats(int num_helios) { num_helios_ = num_helios; }

auto CudaGrid::getBelongingReceiverIndex() const -> int { return belonging_receiver_index_; }

void CudaGrid::setBelongingReceiverIndex(int belonging_receiver_index)
{
    belonging_receiver_index_ = belonging_receiver_index;
}

void CudaGrid::test()
{
    printf("------------test grid begin--------\n");
    printf("\t type=%d, pos=(%f,%f,%f), size=(%f,%f,%f), interval=(%f,%f,%f)\n", type_, pos_.x,
           pos_.y, pos_.z, size_.x, size_.y, size_.z, interval_.x, interval_.y, interval_.z);
    printf("\t helio_type = %d, num_helios=%d, start_helio_index=%d, belonging_receiver_index=%d\n",
           helio_type_, num_helios_, start_helio_index_, belonging_receiver_index_);
    printf("------------test grid end  --------\n");
}
